package emby.lang;

/**
 * Allows emby to throw any object, not just subclasses of Throwable.
 * This class is throwable, and it is a wrapper for a
 * generic object.
 * @author Justin
 */
public class ThrownObject extends RuntimeException{

	private static final long serialVersionUID = 6461593245881054806L;
	Object o; //ThrownObject is a wrapper for this object
	public ThrownObject(Object o){
		this.o=o;
	}
	public Object getObj(){
		return o;
	}
	
	@Override
	public void printStackTrace(){
		if( o instanceof Throwable){
			Throwable t = (Throwable) o;
			t.printStackTrace();
		}else{
			super.printStackTrace();
		}
	}
}
